package naga.x.game.template;

public abstract class Template {

	protected int id = HAS_NO_ID;
	
	public static final int HAS_NO_ID = 0;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public boolean hasId() {
		return id != HAS_NO_ID;
	}
	
	public Class<? extends Template> ofType() {
		return getClass();
	}

	/**
	 * 加载完成后进行验证或者额外的操作
	 * @throws TemplateException
	 */
	public abstract void validate() throws TemplateException;
	
}
